/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hhf.worldzones.services.locationServices.countryServices;

import hhf.flex.annotations.FlexDestination;
import hhf.flex.annotations.services.AddEntities;
import hhf.flex.annotations.services.ArgumentName;
import hhf.flex.annotations.services.CacheServiceId;
import hhf.flex.annotations.services.GenericService;

import hhf.flex.annotations.services.OfflinePolicyEnum;
import hhf.flex.annotations.services.ReferenceGetter;
import hhf.flex.annotations.services.RemoveEntities;
import hhf.worldzones.entities.Country;
import hhf.worldzones.entities.Region;
import hhf.worldzones.exceptions.CountryUnknownException;

import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author HHFrancois
 */
@Local
@FlexDestination
public interface CountryFacadeLocal {

    @GenericService(offlinePolicy = OfflinePolicyEnum.DELAY)
    void test(Country country, Region region, Country country2);

    @GenericService(offlinePolicy = OfflinePolicyEnum.DELAY)
    @AddEntities(entities = "country")
    void persist(@ArgumentName(value = "country") Country country);

    Country merge(Country country);

    /* @LinkedServices(canceledServices = {
    @CanceledService(methodClass = CountryFacadeLocal.class, method = "find", parameters = "toto.code")
    
    })*/
    @GenericService(offlinePolicy = OfflinePolicyEnum.DELAY)
    @RemoveEntities(entities = "toto")
    void remove(
            @ArgumentName(value = "toto") Country country);

    @ReferenceGetter
    Country find(@ArgumentName(value = "tt") @CacheServiceId String id) throws CountryUnknownException;

    @ReferenceGetter(retention = 8000000, acceptOutOfDate = true)
    List<Country> findAll();

    @ReferenceGetter
    List<Country> findRange(int[] range);

    int count();
}
